package com.university.vo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * School entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "school", catalog = "university")

public class School implements java.io.Serializable {

	// Fields

	private Integer schoolId;
	private City city;
	private String schoolName;
	private String schoolInfo;

	// Constructors

	/** default constructor */
	public School() {
	}

	@Override
	public String toString() {
		return "School [schoolId=" + schoolId + ", city=" + city + ", schoolName=" + schoolName + ", schoolInfo="
				+ schoolInfo + "]";
	}

	/** full constructor */
	public School(City city, String schoolName, String schoolInfo) {
		this.city = city;
		this.schoolName = schoolName;
		this.schoolInfo = schoolInfo;
	}

	// Property accessors
	@Id
	@GeneratedValue

	@Column(name = "school_id", unique = true, nullable = false)

	public Integer getSchoolId() {
		return this.schoolId;
	}

	public void setSchoolId(Integer schoolId) {
		this.schoolId = schoolId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "school_cityId")

	public City getCity() {
		return this.city;
	}

	public void setCity(City city) {
		this.city = city;
	}

	@Column(name = "school_name", length = 50)

	public String getSchoolName() {
		return this.schoolName;
	}

	public void setSchoolName(String schoolName) {
		this.schoolName = schoolName;
	}

	@Column(name = "school_info", length = 2000)

	public String getSchoolInfo() {
		return this.schoolInfo;
	}

	public void setSchoolInfo(String schoolInfo) {
		this.schoolInfo = schoolInfo;
	}

}